export interface ExpeditionOrderExtended {
    QRCodePrinted: boolean;
    kitchenSolutions: any[];
}
export class ExpeditionOrder {

    id: string;

    /**
     * 出品单的序列号 ‘K-1-12’
     * 
     * @type {string}
     * @memberOf ExpeditionOrder
     */
    serialNo: string;

    kitchenOrderIds: Array<string>;

    /**
     * 出品人
     * 
     * @type {{ id: string; name: string }}
     * @memberOf ExpeditionOrder
     */
    expediter: { id: string; name: string };

    /**
     * 出品人Id
     * 
     * @type {string}
     * @memberOf ExpeditionOrder
     */
    expediterId: string;
    expediteBeginTime: number;
    expediteFinishTime: number;
    // TODO: 字符串时间

    /**
     * 出品单状态 init 初始化 | 已出品 | 已传菜
     * 
     * @type {string}
     * @memberOf ExpeditionOrder
     */
    status: string;

    terminalId: string;

    deliveryer: { id: string; name: string };
    deliveryerId: string;
    deliveryBeginTime: number;
    deliveryFinishTime: number;

    items: ExpeditionOrderItem[];

    qty: number;
    toString(): string { return "ExpeditionOrder"; }
    //订单来源终端ID
    sourceTerminalId: string;
    kitchenOrderItemId: string;


    //前端UI使用的 fields
    groupedItems?: [
        {
            id: string;
            customerIdentity: string;
            items: Array<ExpeditionOrderItem>
        }
    ]

    //VO
    extend: ExpeditionOrderExtended;

    // 一维码图片
    codePic: string;
    // 下单时间
    orderedTime: number;
}

export interface ExpeditionOrderItem {
    id: string;
    kitchenOrderId: string;
    kitchenOrderItemId: string;
    qty: number;
    inventoryId: string;
    inventoryName: string;
    inventoryCode: string;
    /**
     * 出品人
     * 
     * @type {{ id: string; name: string }}
     * @memberOf ExpeditionOrder
     */
    expediter?: { id: string; name: string };

    /**
     * 出品人Id
     * 
     * @type {string}
     * @memberOf ExpeditionOrder
     */
    expediterId?: string;

    /**
     * 客户标识，台桌名称 | 号牌名称
     * 
     * @type {string}
     * @memberOf ExpeditionOrderItem
     */
    customerIdentity: string;
    //最后一次催菜时间
    remindTime?: number;
    //总催菜次数
    remindCount?: number;
    //退菜数量
    refundQty?: number;
    modifiers: Array<any>;
    description: string;
    tableId: string;

    //
    extended: {
        categories: any;
        table?: {
            zone?: {
                id: string;
                name: string;
            }
        },
        receiveTime: number;
    }
}